package service

import (
	"github.com/go-admin-team/go-admin-core/sdk/service"
	"tuowei.com/app/api/models"
	"tuowei.com/app/api/service/dto"
	cDto "tuowei.com/common/dto"
)

type ApiColleges struct {
	service.Service
}

func (e *ApiColleges) GetSelectedList(c *dto.GetSelectedListReq, list *[]models.Colleges, count *int64) error {
	var data models.SysColleges

	err := e.Orm.Debug().Model(data).
		Scopes(
			cDto.MakeCondition(c.GetNeedSearch()),
		).Find(&list).
		Limit(-1).Offset(-1).Count(count).Error
	if err != nil {
		return err
	}
	return nil

}
